<template>
	<view >
		<cover-view class="content" :class="[isIPX?'isIPXs':'']">
			<block v-for="(item,index) in list" :key="index">
				<cover-view class="items" @click="gourl(index,item.pagePath)">
					<cover-image :src="item.iconPath" mode="aspectFit" class="imgs" v-if="index !=indexTo"></cover-image>
					<cover-image :src="item.selectedIconPath" mode="aspectFit" class="imgs" :class="{'indexImg':item.pagePath=='/pages/yangTo/yangTo'}"
					 v-else></cover-image>
					<cover-view class="tabbarText" v-if="index !=2 || index !=indexTo" :class="{'selectColor':index ==indexTo}">{{item.text}}</cover-view>
				
				</cover-view>
			</block>
		</cover-view>
		<!-- <view class="content" :class="[isIPX?'isIPXs':'']">
			<block v-for="(item,index) in list" :key="index">
				<view class="items" @click="gourl(index,item.pagePath)">
					<image :src="item.iconPath" mode="aspectFit" class="imgs" v-if="index !=indexTo"></image>
					<image :src="item.selectedIconPath" mode="aspectFit" class="imgs" :class="{'indexImg':item.pagePath=='/pages/yangTo/yangTo'}"
					 v-else></image>
					<view class="tabbarText" v-if="index !=2 || index !=indexTo" :class="{'selectColor':index ==indexTo}">{{item.text}}</view>
				
				</view>
			</block>
		</view> -->
	</view>
</template>

<script>
	let app = getApp().globalData;
	import login from '@/components/login.vue'
	import config from '@/common/js/config.js';
	export default {
		props: ['indexTo'],
		components:{
			login
		},
		data() {
			return {
				
				list: [{
						"pagePath": "/pages/index/index",
						"iconPath": `${config.imgUrl}index.png`,
						"selectedIconPath":`${config.imgUrl}index1.png`,
						"text": "首页"
					},
					{
						"pagePath": "/pages/appraisal/appraisal",
						"iconPath":  `${config.imgUrl}cep.png`,
						"selectedIconPath":  `${config.imgUrl}cep1.png`,
						"text": "测评"
					},

					{
						"pagePath": "/pages/yangTo/yangTo",
						"iconPath": `${config.imgUrl}yang.png`,
						"selectedIconPath":  `${config.imgUrl}yang1.png`,
						"text": "选品"

					},
					{
						"pagePath": "/pages/me/me",
						"iconPath":  `${config.imgUrl}me.png`,
						"selectedIconPath": `${config.imgUrl}me1.png`,
						"text": "我的"
					}
				],
				isIPX: app.isIPX,
				isLogin:true,
				url:'',
				// indexTos:0,
			};
		},
		methods: {
			gourl(index, url) {
				// console.log('index', index);
				// app.currentInfo = -1;
				// if(url=='/pages/index/index'){
				// 	uni.reLaunch({
				// 		url:'/pages/index/index'
				// 	})
				// 	return
				// }
				// console.log('app.currentInfo', app.currentInfo)
				uni.switchTab({
					url: url
				})


			},
			
			// fnnc(data){
			// 	console.log(data)
			// 	this.isLogin = data.isLogin;
			// 	if(data.isLogin){
			// 		this.getIndexData(this.url)
			// 	}else{
			// 		this.isLogin =true
			// 	}
				
			// }
		}
	}
</script>

<style lang="scss" scoped>
	.content {
		width: 100%;
		height: 100upx;
		position: fixed;
		bottom: 0;
		z-index: 99;
		display: flex;
		justify-content: space-between;
		border-top: 1px solid #f2f2f2;
		background-color: #FFFFFF;

		.items {
			width: 33%;
			height: 100%;
			display: flex;
			flex-direction: column;
			justify-content: space-around;
			align-items: center;

			.imgs {
				width: 52upx;
				height: 52upx;
			}

			.indexImg {
				width: 88upx;
				height: 88upx;
			}

			.tabbarText {
				font-size: 20upx;
				font-family: PingFangSC-Regular, PingFang SC;
				font-weight: 400;
				color: #B2B2B2;
			}

			.selectColor {
				color: #333333;
			}
		}
	}

	.isIPXs {
		padding-bottom: 68upx;
	}
	// .status-bar{
		
	// }
</style>
